import objectbase
import sunlight

class SunFlower(objectbase.ObjectBase):
    def __init__(self, id, postion):
        self.x, self.y = postion
        super(SunFlower, self).__init__(id, self.computePostion(postion))
        self.hasSunlight = False

    def preSummon(self):
        self.hasSunlight = True

    def hasSummon(self):
        return self.hasSunlight

    def doSummon(self):
        if self.hasSummon():
            self.hasSunlight = False
            return sunlight.SunLight(2, (self.position[0] + 30, self.position[1] - 20))